<template>
  <div>
    <el-row>
      <el-col :span="12"
        ><div class="grid-content">
          <v-chart :options="option1" :watchShallow="true" :auto-resize="true" :style="{ width: '100%', height: '100%' }" /></div
      ></el-col>
      <el-col :span="12"
        ><div class="grid-content"><v-chart :options="option2" :watchShallow="true" :auto-resize="true" :style="{ width: '100%', height: '100%' }" /></div
      ></el-col>
    </el-row>
    <el-row>
      <el-col :span="24">
        <div class="table-sty">
          <el-table :data="tableData" style="width: 100%">
            <el-table-column prop="type" label="异动项"> </el-table-column>
            <el-table-column prop="num" label="异动数量"> </el-table-column>
            <el-table-column label="详情">
              <template slot-scope="scope">
                <el-button type="text" size="small">查看详情</el-button>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </el-col>
    </el-row>
  </div>
</template>
<script>
export default {
  name: 'stafftransfer',
  data() {
    return {
      option1: {
        title: {
          text: '异动报表 异动数量',
          left: 'center'
        },
        tooltip: {
          trigger: 'item'
        },
        legend: {
          top: '5%',
          left: 'center'
        },
        series: [
          {
            type: 'pie',
            radius: ['40%', '70%'],
            avoidLabelOverlap: false,
            label: {
              show: false,
              position: 'center'
            },
            emphasis: {
              label: {
                show: true,
                fontSize: 20,
                fontWeight: 'bold'
              }
            },
            labelLine: {
              show: false
            },
            data: [
              { value: 3, name: '费用信息异动' },
              { value: 4, name: '租金支出异动' },
              { value: 1, name: '电费支出异动' },
              { value: 1, name: '水费支出异动' },
              { value: 2, name: '燃气费支出异动' },
              { value: 3, name: '物业管理费支出异动' }
            ]
          }
        ]
      },
      option2: {
        title: {
          text: '异动报表 异动数量',
          left: 'center'
        },
        xAxis: {
          type: 'category',
          data: ['费用信息异动', '租金支出异动', '电费支出异动', '水费支出异动', '燃气费支出异动', '物业管理费支出异动']
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            data: [3, 4, 1, 1, 1, 2, 3],
            type: 'bar',
            label: {
              show: true,
              position: 'top',
              color: '#333333'
            },
            itemStyle: {
              color: '#4874cb'
            }
          }
        ]
      },
      tableData: [
        {
          type: '费用信息异动',
          num: 3
        },
        {
          type: '租金支出异动',
          num: 4
        },
        {
          type: '电费支出异动',
          num: 1
        },
        {
          type: '水费支出异动',
          num: 1
        },
        {
          type: '燃气费支出异动',
          num: 2
        },
        {
          type: '物业管理费支出异动',
          num: 3
        }
      ]
    };
  }
};
</script>
<style lang="scss" scoped>
.grid-content {
  height: 50vh;
  margin-top: 20px;
}
.table-sty {
  margin: 20px;
}
</style>
